package com.ytooo.service;

import com.ytooo.bean.People;
import org.kie.api.runtime.KieSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class DroolsDemoService {

    @Autowired
    private KieSession session;

    public void testDrools() {
        People people = new People();
        people.setName("达");
        people.setAge(18);
        people.setSex(1);
        people.setDrlType("people");
        session.insert(people);//插入
        session.fireAllRules();//执行规则
    }

}
